#include <stdio.h>
void solution()
{
    int mike,ellie,rohan,fatma;
    int red,violet,bule,green;
    int count=4;
    for(mike = 1; mike <= count; mike++)
    {
        for (ellie = 1; ellie <= count; ellie++)
        {
            for (rohan = 1; rohan <= count; rohan++)
            {
                fatma = 10-mike-ellie-rohan;//fatma可以直接用名次和减去其他人名次
                for (red = 1; red <= count; red++)
                {
                    for (violet = 1; violet <= count; violet++)
                    {
                        for ( bule = 1; bule <= count; bule++)
                        {
                            green=10-red-violet-bule;//green可以直接用名次之和减去其他车的名次
                            if (mike!=ellie&&mike!=rohan&&mike!=fatma&&ellie!=rohan&&ellie!=rohan&&rohan!=fatma//去除排名相同情况
                            &&red!=violet&&red!=green&&red!=bule&&violet!=bule&&violet!=green&&bule!=green//去除排名相同情况
                            &&ellie==violet&&rohan!=green           //Ellie骑紫色的车，Rohan没有骑绿色的车
                            &&mike!=1&&mike!=4&&ellie!=1&&ellie!=4  //Mike和Ellie不是第一，也不是最后
                            &&bule<fatma                            //骑蓝色车的人领先Fatma
                            &&green<violet)                         //骑绿色车的人领先骑紫色车的人
                            {
                                if (mike == 2)
                                    printf("mike第二名\n");
                                if(ellie==2)
                                printf("ellie第二名\n");
                                if (rohan==2)
                                printf("rohan第二名\n");
                                if (fatma==2)
                                printf("fatma第二名\n");

                                //printf("mike%d  ellie%d  rohan%d  fatma%d\n",mike,ellie,rohan,fatma);//看结果情况
                               // printf("red%d  violet%d  bule%d  green%d\n\n",red,violet,bule,green);
                            }
                        }
                    }
                }
            }
        }
    }   

}
int main()
{
    solution();
    return 0;
}